int fib(int n) {
	if (n <= 1)
		return n;
	else {
		int p = 0, q = 0, r = 1;
		for (int i = 2; i <= n; ++i) {
			p = q;
			q = r;
			r = p + q;
		}
		return r;
	}
}